import service from "@/server/serviceIndex";
// 获取订单接口
export const getOrderListAPI = (userId) => {
  return service({
    url: `/pipayshopapi/item-order/getOrderList/${userId}`,
  });
};

// 删除订单接口
export const DelOrderListAPI = (orderId) => {
  return service({
    method: "post",
    url: `/pipayshopapi/order/delOrder/${orderId}`,
  });
};

// 订单超时未支付的失效操作接口
export const fialOrderAPI = (orderId) => {
  return service({
    method: "post",
    url: `/pipayshopapi/item-order/failOrder/${orderId}`,
  });
};

// 根据用户id查询网店的所有订单
export const getMyOrderByUidAPI = (data) => {
  return service({
    url: `/pipayshopapi/order/getOrderList`,
    method: 'POST',
    data: data,
  });
};
// 根据商品名查询网店的所有订单
export const getOrderListByItemNameAPI = (data) => {
  return service({
    url: `/pipayshopapi/order/getOrderListByItemName`,
    method: 'POST',
    data: data,
  });
};
// 订单（未支付 / 已支付）的详情接口
export const getOrderDetailAPI = (orderId) => {
  return service({
    url: `/pipayshopapi/order/getOrderDetail/${orderId}`,
  });
};

// 网店粉丝列表
export const getItemFansAPI = (itemId, pageNum, pageSize) => {
  return service({
    method: "get",
    url: `/pipayshopapi/followfocus/shopFans/${itemId}?pageNum=${pageNum}&pageSize=${pageSize}`,
  });
};

// 订单已完成接口;
export const completedItemAPI = (orderId) => {
  return service({
    method: "post",
    url: `/pipayshopapi/order/completedOrder/${orderId}`,
  });
};

// 支付下单接口;
export const payOrderAPI = (token) => {
  return service({
    method: "post",
    url: `/pipayshopapi/order/payOrder?token=${token}`,
  });
};

// 修改价格接口;
export const changeItemPriceAPI = (token) => {
  return service({
    method: "post",
    url: `/pipayshopapi/order/changePrice?token=${token}`,

  });
};
